-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cdk): Add AppSync:Api_Key as hot swappable and fix a bug with AppSync.function #27559
Conversation
…ppSync.function doesn't allow setting version and runtime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only minor comments, looks great!
const arnParts = physicalName?.split('/'); | ||
if (arnParts && arnParts.length === 4) { | ||
sdkRequestObject.id = arnParts[3]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Arn.html here and do Arn.split
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems the Arn.split
only considers one resourceType or resourceName but not "nested" resource such as in this case arn:aws:appsync:us-east-1:111111111111:apis/apiId/apikeys/api-key-id
Arn.split
returns the entire apiId/apikeys/api-key-id
as the resourceName which then requires a split anyways.
{
service: 'appsync',
resource: 'apis',
partition: 'aws',
region: 'us-east-1',
account: '111111111111',
resourceName: 'apiId/apikeys/api-key-id',
sep: '/',
arnFormat: 'arn:aws:service:region:account:resource/resourceName'
}
Moreover, Arn.split
is in aws-cdk-lib
and the change will require we bump the dependency from dev to runtime which might cause cyclic dependency issue? Let me know what you think
Co-authored-by: Calvin Combs <66279577+comcalvi@users.noreply.github.com>
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…Sync.function (#27559) Add AppSync:Api_Key as hots wappable and fix the bug where AppSync.function doesn't allow setting version and runtime 1. Allow `expires` property of resource `AWS::AppSync::Api_Key` to be hot-swappable 2. Read the Api_Key_id from the physical ARN if not available from resource properties. (It's optional in CFN but mandatory in SDK) 3. UpdateFunction doesn't [allow](https://docs.aws.amazon.com/appsync/latest/APIReference/API_UpdateFunction.html) setting both `functionVersion` and `runtime` in the SDK (allowed in CFN). Update to remove one based on if `code` is provided or `mappingTemplates` 4. Fix a bug where the file returned from S3 was not being decoded from buffer. 5. Increase the timeout and number of retries for concurrent modification of AppSync.Functions. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Add AppSync:Api_Key as hots wappable and fix the bug where AppSync.function doesn't allow setting version and runtime
expires
property of resourceAWS::AppSync::Api_Key
to be hot-swappablefunctionVersion
andruntime
in the SDK (allowed in CFN). Update to remove one based on ifcode
is provided ormappingTemplates
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license